package com.example.projuct.demos.week.week3.chapter2_2;

/**
 * @author jll
 * @createTime 2025/4/27
 * @description 学生类
 * @version: 1.0
 */
public class Student {
    //学生实体类，学号、姓名、性别、年龄
    private String studentNumber;
    private String studentName;
    private String studentSex;
    private int studentAge;
    private Subject studentSubject;



    public Student(String studentNumber, String studentName, String studentSex, int studentAge, Subject studentSubject) {
//        this.studentNumber = studentNumber;
//        this.studentName = studentName;
//        this.studentSex = studentSex;
//        this.studentAge = studentAge;
        this.setStudentNumber(studentNumber);
        this.setStudentName(studentName);
        this.setStudentSex(studentSex);
        this.setStudentAge(studentAge);
        this.setStudentSubject(studentSubject);
    }
    public Student() {
    }



    public String getStudentNumber() {
        return studentNumber;
    }

    public void setStudentNumber(String studentNumber) {
        this.studentNumber = studentNumber;
    }

    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    public String getStudentSex() {
        return studentSex;
    }

    public void setStudentSex(String studentSex) {
        this.studentSex = studentSex;
    }

    public int getStudentAge() {
        return studentAge;
    }

    public void setStudentAge(int studentAge) {
        this.studentAge = studentAge;
    }

    public Subject getStudentSubject() {
        return studentSubject;
    }

    public void setStudentSubject(Subject studentSubject) {
        this.studentSubject = studentSubject;
    }

    public String info() {
        return "学号：" + studentNumber + " 姓名：" + studentName + " 性别：" + studentSex + " 年龄：" + studentAge;
    }

    public String info(String subjectName, String subjectNumber, int subjectLife) {
        return "学号：" + studentNumber + " 姓名：" + studentName + " 性别：" + studentSex + " 年龄：" + studentAge+"所报的专业"
                +subjectName+"专业编号"+subjectNumber+"专业年限"+subjectLife;
    }

    public String info(Subject subject) {
        return "学号：" + studentNumber + " 姓名：" + studentName + " 性别：" + studentSex + " 年龄：" + studentAge+"所报的专业"
                +subject.getSubjectName()+"专业编号"+subject.getSubjectNumber()+"专业年限"+subject.getSubjectLife();
    }
}
